package com.listeningframework.boot.constants;

import org.apache.commons.lang3.StringUtils;

public enum YesNo {
    /**
     * 是
     */
    YES("1"),
    /**
     * 否
     */
    NO("0");

    private String code;

    private YesNo(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static final boolean isYes(String code) {
        return StringUtils.equals(YesNo.YES.getCode(), code);
    }

    public static final boolean isNo(String code) {
        return StringUtils.equals(YesNo.NO.getCode(), code);
    }
}
